package xin.codedream.codelog.model.enums;

/**
 * 返回码
 *
 * @author NGLSL
 * @date 2018/8/4
 */
public enum ResponseEnum {
    /**
     * 返回数据
     */
    SUCCESS_CODE(2000, "操作成功"),
    LOGIN_SUCCESS(2001, "登录成功"),
    POST_ARTICLE_SUCCESS(2002, "文章发布成功"),
    DELETE_ARTICLE_SUCCESS(2003, "文章删除成功"),
    UPDATE_ARTICLE_SUCCESS(2004, "文章更新成功"),
    DELETE_COMMENT_SUCCESS(2005, "评论删除成功"),
    UPDATE_COMMENT_STATUS_SUCCESS(2006, "评论状态更新成功"),
    DELETE_CATEGORY_SUCCESS(2007, "目录删除成功"),
    SAVE_CATEGORY_SUCCESS(2008, "目录保存成功"),
    UPDATE_CATEGORY_SUCCESS(2009, "目录更新成功"),
    DELETE_TAG_SUCCESS(2010, "标签删除成功"),

    ERROR_CODE(5000, "操作失败"),
    LOGIN_ERROR(5001, "登录失败"),
    PARAM_EMPTY(5002, "参数不能为空"),
    POST_ARTICLE_ERROR(5003, "文章发布失败"),
    POST_ARTICLE_TITLE_EXIST(5004, "该文章标题已存在"),
    DELETE_ARTICLE_ERROR(5005, "文章删除失败"),
    UPDATE_ARTICLE_ERROR(5006, "文章更新失败"),
    DELETE_COMMENT_ERROR(5007, "评论删除失败"),
    UPDATE_COMMENT_STATUS_ERROR(5008, "评论状态更新失败"),
    DELETE_CATEGORY_ERROR(5009, "目录删除失败"),
    SAVE_CATEGORY_ERROR(5010, "目录保存失败"),
    UPDATE_CATEGORY_ERROR(5011, "目录更新失败"),
    DELETE_TAG_ERROR(5012, "标签删除失败"),
    ;

    private Integer code;
    private String message;

    ResponseEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
